package xdu.lz.stage3_classloader.chapter1;


import java.util.concurrent.atomic.AtomicBoolean;

class B{
    private static AtomicBoolean init = new AtomicBoolean(true);
    static {
        System.out.println(Thread.currentThread().getName()+" begin");
        while (init.get()){

        }
        System.out.println(Thread.currentThread().getName()+" finish");
    }
}
public class ClinitThreadTest {
    public static void main(String[] args) {
        new Thread(()->{
            new B();
        }).start();
        new Thread(()->{
            new B();
        }).start();
    }
}
